
#pragma once

#include "OpenGL.h"

//planes of frustum
enum FRUSTUM_PLANES
{
	LEFTSIDE = 0,
	RIGHTSIDE,
	TOPSIDE,
	BOTTOMSIDE,
	NEARSIDE,
	FARSIDE
};

enum FRUSTUM_CLASSIFICATION
{
	OUTSIDE_FRUSTUM=0,
	IN_FRUSTUM
};

class GLfrustum
{
public:
	void Update() ;
	void MakeFrustum( GLmat4f view,GLmat4f proj );
	bool IsPointInside(const GLvec3f & point ) const;
	bool IsBoundingBoxInside( const GLbbox& bb ) const;

	GLplanef GetPlane( int index ) const {return planes[index];}
	
	GLmat4f m_view,m_proj;
	GLplanef planes[6];
};

